package edu.uow.devdocs

class DevelopmentTaskService {

    def DevelopmentTask createDefaultDevelopmentTask(String description, Issue issue, Project project, Deployment deployment) {
		def task = new DevelopmentTask()
		task.task = description
		task.issue = issue
		task.priority = 3
		if (deployment) {
			task.deployment = deployment
		}
		task.project = project
		task.status = DevelopmentTaskStatus.initialStatus.get()
		task.dateCreated = new Date()
		issue.addToDevelopmentTasks(task)
		issue.save(flush:true)
		task.save(flush:true)
    }
}
